//用于发布的数据
var publishData = 
{
  images:["../../image/yellowchild.jpg"],
  name:"极美世界设计",
  maxPrice:299,
  minPrice:10,
  qty:5,
  desc:"这是描述",
  duration:1800,
  price:998,
}

var productData = null;

var selectedAddress = null;

var productConfig = null;

var midaiwuConfig = null;

var set_publishData = function(images, name, maxPrice, minPrice, count, desc, duration)
{
  publishData.images = images || [];
  publishData.name = name || "empty";
  publishData.price = maxPrice || 0;
  publishData.maxPrice = maxPrice || 0;
  publishData.minPrice = minPrice || 0;
  publishData.qty = count || 0;
  publishData.desc = desc || "empty";
  publishData.duration = duration || 0;
}

var get_publishData = function()
{
  return publishData;
}

var set_productData = function(data)
{
  productData = data;
}

var get_productData = function()
{
  return productData;
}

var set_selectedAddress = function(id)
{
  selectedAddress = id;
}

var get_selectedAddress = function()
{
  var ret = selectedAddress;
  selectedAddress = null;
  return ret;
}

const set_productConfig = function(config)
{
  productConfig = config;
}

const get_productConfig = function()
{
  return productConfig;
}

const set_midaiwuConfig= function(config)
{
  midaiwuConfig = config;
}

const get_midaiwuConfig = function()
{
  return midaiwuConfig;
}

module.exports = 
{
  set_publishData,
  get_publishData,

  set_productData,
  get_productData,

  set_selectedAddress,
  get_selectedAddress,

  set_productConfig,
  get_productConfig,

  set_midaiwuConfig,
  get_midaiwuConfig
}